-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: zero-bin
is now able again to accesses evm_arithmetization
for circuit versions
#310
Conversation
- Now writes `circuits/` to the root directory and not inside `tools/`.
- Now writes `circuits/` to `zero_bin` and not inside `tools/`.
- Now writes `circuits/` to `zero_bin` and not inside `tools/`.
Any interactions with #357 ? |
ec16420
to
acc8fd1
Compare
e4230fd
to
3df7730
Compare
Overwriting CARGO_WORKSPACE_DIR still feels surprising to me - could you explain why this is the right solution (and not e.g changing the paths in the code so they point to wherever they're supposed to)? I might be missing context :) |
Yeah I don't blame you here, as it's not very obvious what [env] is doing in So like we kind of both agree above, this is a potentially unstable way to get the project directory. Anything specified in Now why this works is not really plain either. When |
Ah I didn't realise this! Having a closer look at the code, it basically looks like have some local asset that we want to bundle in the binary, but fallback to a user-provided one - does that sound right? I can't find a If that is the case, can we |
Yeah I agree with the rename to So the idea is we want to always have the project use a constant circuit directory whenever we run the prover inside of the project directory. When we run the binary and want to figure out where the circuit directory is/should be created, we are doing this:
If we're just distributing a binary around to users without the project directory (question: will we be?), then the best that we can do is to have it default to the current directory or have the user specify the env variable. Also a bit of an aside and maybe only somewhat related, but if the user tries running the scripts in
|
- Renamed "CARGO_WORKSPACE_DIR" --> "ZK_EVM_WORKSPACE_DIR".
Ah I see! See also What do you think about the above?
|
Yeah I think it's a bit of an improvement using a standard directory for storing the circuits. I guess we could switch to using our own crate version at this point. Technically the version of @Nashtare Do you have any thoughts on how we should version circuits? We have the work done at this point to use Also, should we add a |
7a5e13f
to
3fbe039
Compare
Now that we have Alternatively, we could review the way that preprocessing is done now that What we care about for compatibility are:
|
I'd advocate for offloading this onto the user, and making our program less smart with a So we could have separate subcommands for:
This would simplify the code we deliver, allow users to cache as needed, remove some params and concerns from our code. |
Hey @Nashtare I have a dependent upstream PR that handles cleaning up old circuit state which deals with the "bloat" issue. Are we cool to merge this one? |
Ah sorry it got buried in my notifications. I'll try to review it today or tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got lost in my notifications, apologies for the delay.
Will need a rebase with latest changes though, but otherwise no real blocker for me.
Just an update. Once we switch to using the OS directories by default (#405), we don't really need to be setting the |
- Renamed "CARGO_WORKSPACE_DIR" --> "ZK_EVM_WORKSPACE_DIR".
- Was missing `zero_bin`. - Also made the circuit directory error a bit more helpful (now also contains underlying IO error).
- Realized that the kernel hash is the best indicator if two serialized circuits were built using a compatable kernel.
- I don't think we really have a use for this anymore if we are relying solely on the kernel hash for circuit versioning. - Also swapped out the `evm_arithmetization` versioning variable with the kernel hash.
e9a6307
to
3f3a66c
Compare
7273a85
to
5ae99d3
Compare
- If the directory path that we needed to create contained more than `1` directory, it would fail.
5ae99d3
to
0722475
Compare
Should be good to merge now @Nashtare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits then good to me for merging!
Co-authored-by: Robin Salen <[email protected]>
Resolves #304.
Note however that the issue was actually something separate from what is mentioned in the issue.
zero-bin
was actually getting the version ofevm_arithmetization
fromCargo.lock
and was not using tags. The issue waszero-bin
was one directory deeper fromCargo.lock
after it got migrated intozk_evm
.